package com.service;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import com.serviceimpl.*;

public class Program {
	public static void main(String[] args){
		try {
			PersonService personService=new PersonServiceImpl();
			
			LocateRegistry.createRegistry(6600);
			
			try {
				Naming.rebind("rmi://127.0.0.1:6600/PersonService", personService);
				System.out.println("服务器连接成功!");
			} catch (MalformedURLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
